<?php
/**
 * Created by JetBrains PhpStorm.
 * User: shaoshuai
 * Date: 12-7-15
 * Time: 上午12:38
 */

//input: username
//output: online list

include 'boot.php';
session_start();
$myName = $_GET['username'];
$_SESSION['username'] = $myName;

$onlineList = OnlineList::getInstance();
$myself = new User(array('name' => $myName));
$onlineList->addUser($myself);

$output = array(
    'success' => true,
    'data' => $onlineList->getList(),
);
echo json_encode($output);
